//
//  MKCombineInfo.m
//  YangDongXi
//
//  Created by 杨鑫 on 16/1/12.
//  Copyright © 2016年 yangdongxi. All rights reserved.
//

#import "MKCombineInfo.h"
#import "NSString+MKExtension.h"
#import "MKLetTimeInfo.h"

@implementation MKCombineInfo

+ (NSDictionary *)propertyAndKeyMap{
    return @{
            @"supportDelivery":@"support_delivery",
             @"supportPickUp":@"support_pick_up",
             @"settlementInfo":@"settlement_info",
             @"shopInfo":@"shop_info",
            @"storeInfo":@"store_info",
            @"messageText" : @"user_memo"
             };
}
+ (Class)classForArrayItemWithName:(NSString *)propertyName andIndex:(NSInteger)index{
    if ([propertyName isEqualToString:@"settlementInfo"]) {
        return [MKSettlementInfo class];
    }
    if ([propertyName isEqualToString:@"shopInfo"]) {
        return [MKShopInfoObject class];
    }
    if ([propertyName isEqualToString:@"MKLetTimeInfo"]) {
        return [MKLetTimeInfo class];
    }
    return nil;
}
+ (NSString *)combineStringWithMKCombine:(MKCOMBINE)combine{
    return @{
             @(MKCombineCourier):@"快递",
             @(MKCombineSupportDelivery):@"闪送",
             @(MKCombineSupportPickUp):@"到店自提",
        }[@(combine)];
}

+ (NSString *)priceString:(NSInteger)price
{
    return [NSString stringWithFloat:price / 100.0];
}
@end
